#include<bits/stdc++.h>

using namespace std;
//5 6 8 6 9 1 6 1 2 4 9 1 9 8 2 3 6 4 7 7 5 9 5 0 3 8 7 5 8 1 5 8 6 1 8 3 0 3 7 9 2

//7 0 5 8 8 5 7 0 9 9 1 9 4 4 6 8 6 3 3 8 5 1 6 3 4 6 7 0 7 8 2 7 6 8 9 5 6 5 6 1 4 0 1

//0 0 9 4 8 0 9 1 2 8 5 0 2 5 3 3

int arr[] = 
{5,6, 8 ,6, 9, 1, 6, 1,2, 4 ,9 ,1, 9, 8 ,2, 3 ,6 ,4 ,7 ,7 ,5, 9 ,5, 0 ,3 ,8, 7, 5 ,8 ,1 ,5 ,8 ,6, 1, 8, 3 ,0, 3 ,7, 9 ,2

,7 ,0 ,5 ,8 ,8, 5, 7, 0 ,9 ,9, 1 ,9, 4, 4, 6 ,8 ,6 ,3 ,3, 8 ,5 ,1, 6, 3 ,4 ,6 ,7 ,0, 7, 8, 2, 7 ,6, 8 ,9, 5, 6 ,5, 6 ,1, 4, 0 ,1,

0, 0, 9, 4, 8, 0, 9, 1 ,2 ,8 ,5 ,0 ,2, 5, 3,3};

bool check(int year,int month,int day)
{
	if(year == 2023)
	{
		if(month <=0 || month > 12)return false;
		if(month == 1 ||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12 )
		{
			if(day <=31 && day>0)
			{
				return true;
			}
			else return false;
		}
		else if(month == 2)
		{
			if(day > 28 || day <1)return false;
			else return true;
		}
		else
		{
			if(day <= 30 &&day>0)return true;
			else return false;
		}
	}
	return false;
}

int months[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int main()
{
	int len = sizeof(arr)/sizeof(arr[0]),cot = 0;
	for(int month = 1 ; month < 13 ; month++)
	{
		for(int day = 1 ; day <=months[month];day++ )
		{
			int str[] = {2,0,2,3,month/10,month%10,day/10,day%10},ans = 0;
			for(int i = 0 ; i < 100; i++)
			{
				if(arr[i] == str[ans])
				{
					ans++;
					if(ans == 8)
					{
						cot++;
						break;
					}
				}
			}
		}
	}
	cout<<cot;
	return 0;
}
